package com.manlost.biz.baby.model.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * 宝贝类型
 * 
 * @author wqq
 */
public enum BabyType {
    VIDEO("video"), PIC("pic");

    private final String               value;
    private static Map<String, String> babyTypeMap;

    static {
        babyTypeMap = new HashMap<String, String>();
        for (BabyType type : values()) {
            babyTypeMap.put(type.name(), type.getValue());
        }
    }

    public String getValue() {
        return value;
    }

    private BabyType(String value) {
        this.value = value;
    }

    public static BabyType getEnum(String value) {
        for (BabyType type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

    public static Map<String, String> getBabyTypeMap() {
        return babyTypeMap;
    }
}
